import React, { createContext, useContext } from 'react';

export interface ConfigProviderProps {
  /** 是否使用 antd 原生组件 */
  antNative?: boolean;
  /** 子元素 */
  children?: React.ReactNode;
}

export interface ConfigContextType {
  antNative?: boolean;
}

const ConfigContext = createContext<ConfigContextType>({});

export const ConfigProvider: React.FC<ConfigProviderProps> = ({ children, antNative }) => {
  return (
    <ConfigContext.Provider value={{ antNative }}>
      {children}
    </ConfigContext.Provider>
  );
};

export const useConfig = () => {
  return useContext(ConfigContext);
}; 